package com.tuananh.radnom.persist.imp.xml;

import java.util.ArrayList;

import com.ajexperience.utils.DeepCopyException;
import com.ajexperience.utils.DeepCopyUtil;
import com.tuananh.radnom.model.NetElementConfiguration;
import com.tuananh.radnom.model.discovery.DiscoveryConfiguration;
import com.tuananh.radnom.model.protocol.service.ActiveDiscover;
import com.tuananh.radnom.model.protocol.service.PassiveDiscover;
import com.tuananh.radnom.persist.IDiscoverDAO;

public class DiscoverXmlDAO extends XmlDAO implements IDiscoverDAO {
	DiscoveryConfiguration discoverConfig;
	
	public DiscoverXmlDAO(){
		super(DiscoveryConfiguration.path);
		configuration = XmlConfigHolder.discoverConfig;
		try {
			savedConfiguration = (new DeepCopyUtil()).deepCopy(configuration);
		} catch (DeepCopyException e) {
			// TODO Auto-generated catch block
			savedConfiguration = new DiscoveryConfiguration();
			e.printStackTrace();
		}
		discoverConfig = (DiscoveryConfiguration) configuration;
	}
	public boolean isActiveDiscover(){
		return discoverConfig.getActiveDiscover();
	}
	public boolean isPassiveDiscover(){
		return discoverConfig.getPassiveDiscover();
	}
	public ArrayList<PassiveDiscover> getAllPassiveDiscover(){
		return discoverConfig.getPassiveDiscovers();
	}
	public ArrayList<ActiveDiscover> getAllActiveDiscover() {
		// TODO Auto-generated method stub
		return discoverConfig.getActiveDiscovers();
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

}
